package org.dyyx.nrest.rest.convert;

import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

final class DateConverter implements Converter<Date> {

    
    @Override
    public Date convert(Object source) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            return sdf.parse(source.toString());
        } catch (ParseException e) {
            return null;
        }
    }

}
